{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
  <h3 class="pb-3">配置</h3>
  <table class="layui-table layui-table-form">
    <input type="hidden" value="{$id}" name="id">
    <tr>
      <td class="layui-td-gray">积分说明</td>
      <td>
				<textarea class="layui-textarea" id="container_content">
					{notempty name="$config.explain" }{$config.explain}{/notempty}
				</textarea>
      </td>
    </tr>

  </table>

  <div class="py-3">
    <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
  const moduleInit = ['tool','tinymce'];
  function gouguInit() {
    var form = layui.form, tool = layui.tool;
    var edits = layui.tinymce.render({
      selector: '#container_contents',
      height: 500
    });
    var edit = layui.tinymce.render({
      selector: '#container_content',
      height: 500
    });

    //监听提交
    form.on('submit(webform)', function (data) {
      data.field.explain = tinyMCE.editors['container_content'].getContent();
      let callback = function (e) {
        layer.msg(e.msg);
        if (e.code == 0) {
          parent.layui.tool.close(1000);
        }
      }
      tool.post("/admin/conf/edit", data.field, callback);
      return false;
    });
  }
</script>
{/block}
<!-- /脚本 -->